.class public Lcom/nemustech/tiffany/world/TFReverseEffect;
.super Lcom/nemustech/tiffany/world/TFCustomPanel$Blender;
.source "TFReverseEffect.java"


# static fields
.field public static final DEFAULT_DURATION:I = 0x5dc

.field public static final DEFAULT_REVERSE_DURATION:I = 0x1e

.field private static final TAG:Ljava/lang/String; = "TFReverseEffect"


# instance fields
.field private final mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

.field protected mDuration:I

.field protected final mIdentity:[F

.field private final mMeshH:I

.field private final mMeshW:I

.field protected mReverseDuration:I

.field private final mTime:Lcom/nemustech/tiffany/world/TFCustomPanel$Time;

.field private mVertex:[F

.field private mVertexStack:Ljava/util/Stack;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Stack",
            "<[F>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lcom/nemustech/tiffany/world/TFCustomPanel;Ljava/util/Stack;)V
    .locals 2
    .parameter "customPanel"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/nemustech/tiffany/world/TFCustomPanel;",
            "Ljava/util/Stack",
            "<[F>;)V"
        }
    .end annotation

    .prologue
    .line 22
    .local p2, stack:Ljava/util/Stack;,"Ljava/util/Stack<[F>;"
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFCustomPanel$Blender;-><init>()V

    .line 23
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    .line 24
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFCustomPanel;->getMeshWidth()I

    move-result v0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mMeshW:I

    .line 25
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFCustomPanel;->getMeshHeight()I

    move-result v0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mMeshH:I

    .line 26
    new-instance v0, Lcom/nemustech/tiffany/world/TFCustomPanel$Time;

    invoke-direct {v0}, Lcom/nemustech/tiffany/world/TFCustomPanel$Time;-><init>()V

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mTime:Lcom/nemustech/tiffany/world/TFCustomPanel$Time;

    .line 28
    iget v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mMeshH:I

    add-int/lit8 v0, v0, 0x1

    iget v1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mMeshW:I

    add-int/lit8 v1, v1, 0x1

    mul-int/2addr v0, v1

    mul-int/lit8 v0, v0, 0x3

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mIdentity:[F

    .line 29
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mIdentity:[F

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFCustomPanel;->loadIdentityVertex([F)V

    .line 30
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFCustomPanel;->getVertex()[F

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertex:[F

    .line 32
    const/16 v0, 0x1e

    iput v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mReverseDuration:I

    .line 33
    const/16 v0, 0x5dc

    iput v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mDuration:I

    .line 35
    iput-object p2, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertexStack:Ljava/util/Stack;

    .line 36
    return-void
.end method

.method private blend()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    .line 60
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertexStack:Ljava/util/Stack;

    invoke-virtual {v1}, Ljava/util/Stack;->pop()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [F

    .line 61
    .local v0, vertex:[F
    if-nez v0, :cond_0

    .line 63
    :goto_0
    return-void

    .line 62
    :cond_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertex:[F

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertex:[F

    array-length v2, v2

    invoke-static {v0, v3, v1, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    goto :goto_0
.end method


# virtual methods
.method public hasEnded()Z
    .locals 1

    .prologue
    .line 40
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertexStack:Ljava/util/Stack;

    invoke-virtual {v0}, Ljava/util/Stack;->empty()Z

    move-result v0

    return v0
.end method

.method public onEnd()V
    .locals 0

    .prologue
    .line 46
    return-void
.end method

.method public onFrame(I)V
    .locals 1
    .parameter "tick"

    .prologue
    .line 50
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mTime:Lcom/nemustech/tiffany/world/TFCustomPanel$Time;

    invoke-virtual {v0, p1}, Lcom/nemustech/tiffany/world/TFCustomPanel$Time;->update(I)Z

    move-result v0

    if-nez v0, :cond_1

    .line 57
    :cond_0
    :goto_0
    return-void

    .line 53
    :cond_1
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mVertexStack:Ljava/util/Stack;

    invoke-virtual {v0}, Ljava/util/Stack;->empty()Z

    move-result v0

    if-nez v0, :cond_0

    .line 55
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFReverseEffect;->blend()V

    .line 56
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mCustomPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFCustomPanel;->requestUpdateVertex()V

    goto :goto_0
.end method

.method public onStart()V
    .locals 3

    .prologue
    .line 67
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mTime:Lcom/nemustech/tiffany/world/TFCustomPanel$Time;

    iget v1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mDuration:I

    iget v2, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mReverseDuration:I

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/tiffany/world/TFCustomPanel$Time;->start(II)V

    .line 68
    return-void
.end method

.method public setReverseDuration(II)V
    .locals 1
    .parameter "duration"
    .parameter "reverseDuration"

    .prologue
    .line 71
    if-lez p2, :cond_0

    if-lt p2, p1, :cond_1

    .line 72
    :cond_0
    mul-int/lit8 v0, p1, 0x3

    div-int/lit8 p2, v0, 0x4

    .line 73
    :cond_1
    iput p1, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mDuration:I

    .line 74
    iput p2, p0, Lcom/nemustech/tiffany/world/TFReverseEffect;->mReverseDuration:I

    .line 75
    return-void
.end method
